<template>
	<view class="container">
		<view style="width: 100%;height: 20rpx;"></view>
		<view class="list_view">
			<view class="item_view" v-for="(item, index) in dataList" :key="index" @click="tenantAction(item)">
				{{ item.tenantName }}
			</view>
		</view>
		<u-empty text="暂无数据" mode="list" v-if="dataList.length==0" :margin-top="300"></u-empty>
	</view>
</template>

<script>
	export default {
		components: {},
		data() {
			return {
				keyword: '',
				dataList: []
			}
		},
		onLoad() {
			this.getTenantData()
		},
		methods: {
			getTenantData() {
				var that = this
				this.$apis.getTenant().then(result => {
					if (result.res.data.code == '200') {
						that.dataList = result.res.data.data;
					} else {
						this.$show.toastMessage(result.res.data.msg);
					}
				})
			},
			tenantAction(e) {
				uni.$emit('seletedTenant', e);
				uni.navigateBack()
			}
		}
	}
</script>

<style lang="scss" scoped>
	.container {
		width: 100%;
		min-height: 100vh;
		box-sizing: border-box;
		background-color: #F8F8F8;
	}

	.list_view {
		.item_view {
			display: flex;
			flex-direction: row;
			justify-content: space-between;
			align-items: center;
			padding: 20rpx;
			background-color: #FFFFFF;
			border-radius: 10rpx;
			border-bottom: 1rpx solid #E8E8E8;

			.left_view {
				display: flex;
				flex-direction: row;
				align-items: center;

				.icon_view {
					width: 100rpx;
					height: 100rpx;
				}

				.content_view {
					margin-left: 20rpx;
				}
			}
		}
	}
</style>